package com.hcandtx.Bms.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hcandtx.Bms.bean.messageBoard;
import com.hcandtx.Bms.service.IMessageService;

@Controller("messageBoardController")
@ResponseBody
public class MessageBoardController {
	
	@Autowired
	IMessageService messageService;
	
	
	@RequestMapping("/message/addmessage")
	public int addmessage(messageBoard message) {
		System.out.println(message);
		int n=messageService.addmessage(message);
		return n ;
		
	}
	
	@RequestMapping("/message/getmessagedata")
	public List<messageBoard> showMessage(String productName){
		System.out.println(productName);
		List<messageBoard> messageList= messageService.findAll(productName);
		return messageList;
		
	}
}
